package com.softe.client.objects;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * This class represents an Issue that a team might be facing
 * during a software project.
 * @author Kelly Grogan
 * @version 1.0.1
 */
public class Issue {
	
	/**
	 * The severity of the Issue
	 */
	private Severity severity;
	
	/**
	 * The title of the Issue
	 */
	private String title;
	
	/**
	 * A description of the Issue
	 */
	private String description;
	
	/**
	 * The date the Issue was created
	 */
	private String date;
	
	/**
	 * Constructor for an Issue
	 * @param severity The Issue's Severity
	 * @param title The title of the Issue
	 * @param description The description of the Issue
	 */
	public Issue(Severity severity, String title, String description) {
		super();
		this.severity = severity;
		this.title = title;
		this.description = description;
		DateFormat fmt = new SimpleDateFormat("MM/dd/yyyy 'at' HH:mm:ss");
		this.date = fmt.format(Calendar.getInstance().getTime());
	}

	/**
	 * Gets the Issue's Severity
	 * @return severity
	 */
	public Severity getSeverity() {
		return severity;
	}

	/**
	 * Sets the Issue's Severity
	 * @param severity
	 */
	public void setSeverity(Severity severity) {
		this.severity = severity;
	}

	/**
	 * Gets the Issue's title
	 * @return title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * Sets the Issue's title
	 * @param title
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * Gets the Issue's description
	 * @return description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Sets the Issue's description
	 * @param description
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Gets the date the Issue was created
	 * @return
	 */
	public String getDate() {
		return date;
	}
}